<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>

<title>Minimize (randoop 4.1.0 API)</title>

<link rel="stylesheet" type="text/css" href="../../javadocstyle.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="Minimize (randoop 4.1.0 API)";
        }
    }
    catch(err) {
    }
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":10,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9,"i19":9,"i20":9,"i21":9,"i22":9,"i23":9,"i24":9,"i25":10,"i26":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../randoop/main/Main.html" title="class in randoop.main"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../randoop/main/Minimize.Outputs.html" title="class in randoop.main"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?randoop/main/Minimize.html" target="_top">Frames</a></li>
<li><a href="Minimize.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">randoop.main</div>
<h2 title="Class Minimize" class="title">Class Minimize</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../randoop/main/CommandHandler.html" title="class in randoop.main">randoop.main.CommandHandler</a></li>
<li>
<ul class="inheritance">
<li>randoop.main.Minimize</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">Minimize</span>
extends <a href="../../randoop/main/CommandHandler.html" title="class in randoop.main">CommandHandler</a></pre>
<div class="block">This program minimizes a failing JUnit test suite. Its three command-line arguments are:

 <ol>
   <li>the Java file whose failing tests will be minimized
   <li>an optional classpath containing dependencies needed to compile and run the Java file
   <li>an optional timeout limit, in seconds, allowed for the whole test suite to run. The default
       is 30 seconds.
 </ol>

 <p>The minimizer will only attempt to minimize methods that are annotated with the @Test
 annotation. In a method that contains a failing assertion, the minimizer will iterate through the
 statements of the method, from last to first. For each statement, it tries possible replacement
 statements, from most minimized to least minimized. Removing the statement is the most a
 statement can be minimized. Leaving the statement unchanged is the least that the statement can
 be minimized.

 <p>If a replacement causes the output test suite to fail differently than the original test
 suite, the algorithm tries a different replacement. If no replacement allows the output test
 suite to fail in the same way as the original test suite, the algorithm adds back the original
 version of the current statement and continues.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!--   -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.Outputs.html" title="class in randoop.main">Minimize.Outputs</a></span></code>
<div class="block">Contains the standard output, standard error, and exit status from running a process.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#minimizetimeout">minimizetimeout</a></span></code>
<div class="block">The maximum number of seconds allowed for the entire minimization process</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#PATH_SEPARATOR">PATH_SEPARATOR</a></span></code>
<div class="block">Path separator as defined by the system, used to separate elements of the classpath.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#SUFFIX">SUFFIX</a></span></code>
<div class="block">The suffix to postpend onto the name of the minimized file and class.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#suiteclasspath">suiteclasspath</a></span></code>
<div class="block">Classpath that includes dependencies needed to compile and run the JUnit test suite being
 minimized.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#suitepath">suitepath</a></span></code>
<div class="block">The Java file whose failing tests will be minimized.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#SYSTEM_CLASS_PATH">SYSTEM_CLASS_PATH</a></span></code>
<div class="block">System class path, a part of the classpath that is used to compile and run the input test
 suite.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#testsuitetimeout">testsuitetimeout</a></span></code>
<div class="block">The maximum number of seconds allowed for the entire test suite to run.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#verboseminimizer">verboseminimizer</a></span></code>
<div class="block">Output verbose output to standard output if true.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.randoop.main.CommandHandler">
<!--   -->
</a>
<h3>Fields inherited from class&nbsp;randoop.main.<a href="../../randoop/main/CommandHandler.html" title="class in randoop.main">CommandHandler</a></h3>
<code><a href="../../randoop/main/CommandHandler.html#fcommand">fcommand</a>, <a href="../../randoop/main/CommandHandler.html#fcommandGrammar">fcommandGrammar</a>, <a href="../../randoop/main/CommandHandler.html#fexample">fexample</a>, <a href="../../randoop/main/CommandHandler.html#finput">finput</a>, <a href="../../randoop/main/CommandHandler.html#fnotes">fnotes</a>, <a href="../../randoop/main/CommandHandler.html#foptions">foptions</a>, <a href="../../randoop/main/CommandHandler.html#foutput">foutput</a>, <a href="../../randoop/main/CommandHandler.html#fpitch">fpitch</a>, <a href="../../randoop/main/CommandHandler.html#fsummary">fsummary</a>, <a href="../../randoop/main/CommandHandler.html#fwhere">fwhere</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#Minimize--">Minimize</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#addImport-com.github.javaparser.ast.CompilationUnit-java.lang.String-">addImport</a></span>(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
         <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;importName)</code>
<div class="block">Add an import to the list of <code>ImportDeclaration</code>s of the compilation unit.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>private static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#checkCorrectlyMinimized-java.nio.file.Path-java.lang.String-java.lang.String-java.util.Map-int-">checkCorrectlyMinimized</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                       <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
                       <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
                       <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;expectedOutput,
                       int&nbsp;timeoutLimit)</code>
<div class="block">Check if a Java file has been correctly minimized.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#cleanUp-java.nio.file.Path-boolean-">cleanUp</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;outputFile,
       boolean&nbsp;verboseOutput)</code>
<div class="block">Deletes the .class file associated with the outputFile.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>private static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#compileJavaFile-java.nio.file.Path-java.lang.String-java.lang.String-int-">compileJavaFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
               <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
               <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
               int&nbsp;timeoutLimit)</code>
<div class="block">Compile a Java file and return the compilation exit value.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#getExecutionDirectory-java.nio.file.Path-java.lang.String-">getExecutionDirectory</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                     <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName)</code>
<div class="block">Get directory to execute command in, given file path and package name.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>private static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#getFileLength-java.nio.file.Path-">getFileLength</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file)</code>
<div class="block">Calculate the length of a file, by number of lines.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>private static com.github.javaparser.ast.expr.LiteralExpr</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#getLiteralExpression-java.lang.String-com.github.javaparser.ast.type.PrimitiveType.Primitive-">getLiteralExpression</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value,
                    com.github.javaparser.ast.type.PrimitiveType.Primitive&nbsp;type)</code>
<div class="block">Return a literal expression with the value that is passed in.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>private static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#getNumberOfTestMethods-com.github.javaparser.ast.CompilationUnit-">getNumberOfTestMethods</a></span>(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit)</code>
<div class="block">Return the number of JUnit test methods in a compilation unit</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;com.github.javaparser.ast.stmt.Statement&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#getStatementReplacements-com.github.javaparser.ast.stmt.Statement-java.util.Map-">getStatementReplacements</a></span>(com.github.javaparser.ast.stmt.Statement&nbsp;currStmt,
                        <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;primitiveValues)</code>
<div class="block">Return a list of statements that are a simplification of a given statement, in order from most
 to least minimized.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#handle-java.lang.String:A-">handle</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;args)</code>
<div class="block">Check that the required parameters have been specified by the command-line options and then
 call the mainMinimize method.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>private static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#isTestMethod-com.github.javaparser.ast.body.MethodDeclaration-">isTestMethod</a></span>(com.github.javaparser.ast.body.MethodDeclaration&nbsp;methodDeclaration)</code>
<div class="block">Check if the method is a JUnit test method.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#mainMinimize-java.nio.file.Path-java.lang.String-int-boolean-">mainMinimize</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
            <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classPath,
            int&nbsp;timeoutLimit,
            boolean&nbsp;verboseOutput)</code>
<div class="block">Minimize the input test file.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#minimizeMethod-com.github.javaparser.ast.body.MethodDeclaration-com.github.javaparser.ast.CompilationUnit-java.lang.String-java.nio.file.Path-java.lang.String-java.util.Map-int-">minimizeMethod</a></span>(com.github.javaparser.ast.body.MethodDeclaration&nbsp;method,
              com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
              <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
              <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
              <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
              <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;expectedOutput,
              int&nbsp;timeoutLimit)</code>
<div class="block">Minimize a method by minimizing each statement in turn.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#minimizeTestSuite-com.github.javaparser.ast.CompilationUnit-java.lang.String-java.nio.file.Path-java.lang.String-java.util.Map-int-boolean-">minimizeTestSuite</a></span>(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
                 <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
                 <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                 <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
                 <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;expectedOutput,
                 int&nbsp;timeoutLimit,
                 boolean&nbsp;verboseOutput)</code>
<div class="block">Visit and minimize every JUnit test method within a compilation unit.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#normalizeJUnitOutput-java.lang.String-">normalizeJUnitOutput</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;input)</code>
<div class="block">Normalize the standard output obtained from running a JUnit test suite.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#printProgress-int-int-java.lang.String-">printProgress</a></span>(int&nbsp;currentTestIndex,
             int&nbsp;totalTests,
             <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;testName)</code>
<div class="block">Output the minimizer's current progress</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>private static com.github.javaparser.ast.stmt.Statement</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#removeLeftHandSideSimplification-com.github.javaparser.ast.expr.VariableDeclarationExpr-">removeLeftHandSideSimplification</a></span>(com.github.javaparser.ast.expr.VariableDeclarationExpr&nbsp;vdExpr)</code>
<div class="block">Return a statement that contains only the right hand side of a given statement.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>private static com.github.javaparser.ast.stmt.Statement</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#rhsAssignValueFromPassingAssertion-com.github.javaparser.ast.expr.VariableDeclarationExpr-java.util.Map-">rhsAssignValueFromPassingAssertion</a></span>(com.github.javaparser.ast.expr.VariableDeclarationExpr&nbsp;vdExpr,
                                  <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;primitiveValues)</code>
<div class="block">Return a variable declaration statement that simplifies the right hand side by a calculated
 value for primitive types.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>private static com.github.javaparser.ast.stmt.Statement</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#rhsAssignWithValue-com.github.javaparser.ast.expr.VariableDeclarationExpr-com.github.javaparser.ast.type.Type-java.lang.String-">rhsAssignWithValue</a></span>(com.github.javaparser.ast.expr.VariableDeclarationExpr&nbsp;vdExpr,
                  com.github.javaparser.ast.type.Type&nbsp;exprType,
                  <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code>
<div class="block">Return a variable declaration statement that sets the right hand side of a variable declaration
 to the value that is passed in.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;com.github.javaparser.ast.stmt.Statement&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#rhsAssignZeroValue-com.github.javaparser.ast.expr.VariableDeclarationExpr-">rhsAssignZeroValue</a></span>(com.github.javaparser.ast.expr.VariableDeclarationExpr&nbsp;vdExpr)</code>
<div class="block">Return a list of variable declaration statements that could replace the right hand side by 0,
 false, or null, whichever is type correct.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>private static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#runJavaFile-java.nio.file.Path-java.lang.String-java.lang.String-int-">runJavaFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
           <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userClassPath,
           <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
           int&nbsp;timeoutLimit)</code>
<div class="block">Run a Java file and return the standard output.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>private static <a href="../../randoop/main/Minimize.Outputs.html" title="class in randoop.main">Minimize.Outputs</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#runProcess-java.lang.String-java.nio.file.Path-int-">runProcess</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;command,
          <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;executionDir,
          int&nbsp;timeoutLimit)</code>
<div class="block">Run a command given as a String and return the output and error results in an Outputs object.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>private static com.github.javaparser.ast.CompilationUnit</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#simplifyTypeNames-com.github.javaparser.ast.CompilationUnit-java.lang.String-java.nio.file.Path-java.lang.String-java.util.Map-int-boolean-">simplifyTypeNames</a></span>(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
                 <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
                 <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                 <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
                 <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;expectedOutput,
                 int&nbsp;timeoutLimit,
                 boolean&nbsp;verboseOutput)</code>
<div class="block">Simplify the type names in a compilation unit.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#sortImports-com.github.javaparser.ast.CompilationUnit-">sortImports</a></span>(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit)</code>
<div class="block">Sort a compilation unit's imports by name.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#storeValueFromAssertion-com.github.javaparser.ast.stmt.Statement-java.util.Map-java.util.Set-">storeValueFromAssertion</a></span>(com.github.javaparser.ast.stmt.Statement&nbsp;currStmt,
                       <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;primitiveValues,
                       <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;primitiveAndWrappedTypeVars)</code>
<div class="block">If <code>currStmt</code> is a statement that is an assertTrue statement using an '==' operator,
 store the value associated with the variable in the <code>primitiveValues</code> map.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>private void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#usage-java.lang.String-java.lang.Object...-">usage</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
     <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;args)</code>
<div class="block">Print message, then print usage information.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/main/Minimize.html#writeToFile-com.github.javaparser.ast.CompilationUnit-java.nio.file.Path-">writeToFile</a></span>(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
           <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file)</code>
<div class="block">Write a compilation unit to a Java file.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.randoop.main.CommandHandler">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;randoop.main.<a href="../../randoop/main/CommandHandler.html" title="class in randoop.main">CommandHandler</a></h3>
<code><a href="../../randoop/main/CommandHandler.html#handles-java.lang.String-">handles</a>, <a href="../../randoop/main/CommandHandler.html#printHTML-java.io.PrintStream-">printHTML</a>, <a href="../../randoop/main/CommandHandler.html#usageMessage-java.io.PrintStream-">usageMessage</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="suitepath">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>suitepath</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> suitepath</pre>
<div class="block">The Java file whose failing tests will be minimized.</div>
</li>
</ul>
<a name="suiteclasspath">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>suiteclasspath</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> suiteclasspath</pre>
<div class="block">Classpath that includes dependencies needed to compile and run the JUnit test suite being
 minimized.</div>
</li>
</ul>
<a name="minimizetimeout">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>minimizetimeout</h4>
<pre>public static&nbsp;int minimizetimeout</pre>
<div class="block">The maximum number of seconds allowed for the entire minimization process</div>
</li>
</ul>
<a name="testsuitetimeout">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testsuitetimeout</h4>
<pre>public static&nbsp;int testsuitetimeout</pre>
<div class="block">The maximum number of seconds allowed for the entire test suite to run.</div>
</li>
</ul>
<a name="verboseminimizer">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>verboseminimizer</h4>
<pre>public static&nbsp;boolean verboseminimizer</pre>
<div class="block">Output verbose output to standard output if true.</div>
</li>
</ul>
<a name="PATH_SEPARATOR">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PATH_SEPARATOR</h4>
<pre>private static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> PATH_SEPARATOR</pre>
<div class="block">Path separator as defined by the system, used to separate elements of the classpath.</div>
</li>
</ul>
<a name="SYSTEM_CLASS_PATH">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SYSTEM_CLASS_PATH</h4>
<pre>private static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> SYSTEM_CLASS_PATH</pre>
<div class="block">System class path, a part of the classpath that is used to compile and run the input test
 suite.</div>
</li>
</ul>
<a name="SUFFIX">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SUFFIX</h4>
<pre>private static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> SUFFIX</pre>
<div class="block">The suffix to postpend onto the name of the minimized file and class.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../constant-values.html#randoop.main.Minimize.SUFFIX">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="Minimize--">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Minimize</h4>
<pre>Minimize()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="handle-java.lang.String:A-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handle</h4>
<pre>public&nbsp;boolean&nbsp;handle(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;args)</pre>
<div class="block">Check that the required parameters have been specified by the command-line options and then
 call the mainMinimize method.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../randoop/main/CommandHandler.html#handle-java.lang.String:A-">handle</a></code>&nbsp;in class&nbsp;<code><a href="../../randoop/main/CommandHandler.html" title="class in randoop.main">CommandHandler</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>args</code> - parameters, specified in command-line style, for the input file, the classpath, the
     timeout value, and the verbose flag</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the command was handled successfully</dd>
</dl>
</li>
</ul>
<a name="mainMinimize-java.nio.file.Path-java.lang.String-int-boolean-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mainMinimize</h4>
<pre>public static&nbsp;boolean&nbsp;mainMinimize(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                                   <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classPath,
                                   int&nbsp;timeoutLimit,
                                   boolean&nbsp;verboseOutput)
                            throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Minimize the input test file.

 <p>Given an input Java file, minimization produces a smaller file that fails in the same way as
 the original, having the same failing assertions with the same stack trace.

 <ol>
   <li>Same failing assertions as in the original input test suite.
   <li>Same stacktrace produced by failing assertions.
 </ol>

 <p>The original input Java file will be compiled and run once. The "expected output" derived
 from the standard output from running the input file is a map from test method name to failure
 stack trace. A method is included in the map only if the method contains a failing assertion.
 Thus, the "expected output" of running a test suite with no failing tests will be an empty map.
 The "expected output" will be used during subsequent runs of the modified test suite to
 determine whether or not the test suite still fails in the same way.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the Java file that is being minimized</dd>
<dd><code>classPath</code> - classpath used to compile and run the Java file</dd>
<dd><code>timeoutLimit</code> - number of seconds allowed for the whole test suite to run</dd>
<dd><code>verboseOutput</code> - whether to produce verbose output</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if minimization produced a (possibly unchanged) file that fails the same way as
     the original file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if write to file fails</dd>
</dl>
</li>
</ul>
<a name="minimizeTestSuite-com.github.javaparser.ast.CompilationUnit-java.lang.String-java.nio.file.Path-java.lang.String-java.util.Map-int-boolean-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>minimizeTestSuite</h4>
<pre>private static&nbsp;void&nbsp;minimizeTestSuite(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
                                      <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
                                      <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                                      <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
                                      <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;expectedOutput,
                                      int&nbsp;timeoutLimit,
                                      boolean&nbsp;verboseOutput)
                               throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Visit and minimize every JUnit test method within a compilation unit.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>compilationUnit</code> - the compilation unit to minimize; is modified by side effect</dd>
<dd><code>packageName</code> - the package that the Java file is in</dd>
<dd><code>file</code> - the Java file that is being minimized; is modified by side effect</dd>
<dd><code>classpath</code> - classpath used to compile and run the Java file</dd>
<dd><code>expectedOutput</code> - expected JUnit output when the Java file is compiled and run</dd>
<dd><code>timeoutLimit</code> - number of seconds allowed for the whole test suite to run</dd>
<dd><code>verboseOutput</code> - whether or not to output information about minimization status</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - thrown if minimized method can't be written to file</dd>
</dl>
</li>
</ul>
<a name="isTestMethod-com.github.javaparser.ast.body.MethodDeclaration-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isTestMethod</h4>
<pre>private static&nbsp;boolean&nbsp;isTestMethod(com.github.javaparser.ast.body.MethodDeclaration&nbsp;methodDeclaration)</pre>
<div class="block">Check if the method is a JUnit test method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>methodDeclaration</code> - the method declaration to check</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the method is a JUnit test method</dd>
</dl>
</li>
</ul>
<a name="minimizeMethod-com.github.javaparser.ast.body.MethodDeclaration-com.github.javaparser.ast.CompilationUnit-java.lang.String-java.nio.file.Path-java.lang.String-java.util.Map-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>minimizeMethod</h4>
<pre>private static&nbsp;void&nbsp;minimizeMethod(com.github.javaparser.ast.body.MethodDeclaration&nbsp;method,
                                   com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
                                   <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
                                   <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                                   <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
                                   <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;expectedOutput,
                                   int&nbsp;timeoutLimit)
                            throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Minimize a method by minimizing each statement in turn.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>method</code> - the method to minimize; is modified by side effect</dd>
<dd><code>compilationUnit</code> - compilation unit for the Java file that we are minimizing; is modified
     by side effect</dd>
<dd><code>packageName</code> - the package that the Java file is in</dd>
<dd><code>file</code> - the Java file that is being minimized; is modified by side effect</dd>
<dd><code>classpath</code> - classpath needed to compile and run the Java file</dd>
<dd><code>expectedOutput</code> - expected output from running the JUnit test suite</dd>
<dd><code>timeoutLimit</code> - number of seconds allowed for the whole test suite to run</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - thrown if write to file fails</dd>
</dl>
</li>
</ul>
<a name="storeValueFromAssertion-com.github.javaparser.ast.stmt.Statement-java.util.Map-java.util.Set-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>storeValueFromAssertion</h4>
<pre>private static&nbsp;void&nbsp;storeValueFromAssertion(com.github.javaparser.ast.stmt.Statement&nbsp;currStmt,
                                            <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;primitiveValues,
                                            <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;primitiveAndWrappedTypeVars)</pre>
<div class="block">If <code>currStmt</code> is a statement that is an assertTrue statement using an '==' operator,
 store the value associated with the variable in the <code>primitiveValues</code> map.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>currStmt</code> - a statement</dd>
<dd><code>primitiveValues</code> - a map of variable names to variable values; modified if <code>currStmt</code>
     is a passing assertion, asserting a variable's value</dd>
<dd><code>primitiveAndWrappedTypeVars</code> - set containing the names of all primitive and wrapped type
     variables</dd>
</dl>
</li>
</ul>
<a name="getStatementReplacements-com.github.javaparser.ast.stmt.Statement-java.util.Map-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStatementReplacements</h4>
<pre>private static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;com.github.javaparser.ast.stmt.Statement&gt;&nbsp;getStatementReplacements(com.github.javaparser.ast.stmt.Statement&nbsp;currStmt,
                                                                                       <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;primitiveValues)</pre>
<div class="block">Return a list of statements that are a simplification of a given statement, in order from most
 to least minimized. The possible minimizations are:

 <ul>
   <li>Remove a statement, represented by null.
   <li>Replace the right hand side expression with <code>0</code>, <code>false</code>, or <code>null</code>.
   <li>Replace right hand side by a calculated value obtained from a passing assertion.
   <li>Remove the left hand side of a statement, retaining only the expression on the right.
 </ul>

 <p>Assertions are never simplified, only removed completely.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>currStmt</code> - statement to simplify</dd>
<dd><code>primitiveValues</code> - map of primitive variable names to expressions representing their values</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>list of statements, where each is a possible simplification of <code>currStmt</code></dd>
</dl>
</li>
</ul>
<a name="rhsAssignZeroValue-com.github.javaparser.ast.expr.VariableDeclarationExpr-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rhsAssignZeroValue</h4>
<pre>private static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;com.github.javaparser.ast.stmt.Statement&gt;&nbsp;rhsAssignZeroValue(com.github.javaparser.ast.expr.VariableDeclarationExpr&nbsp;vdExpr)</pre>
<div class="block">Return a list of variable declaration statements that could replace the right hand side by 0,
 false, or null, whichever is type correct. Returns an empty list if there are multiple variable
 declarations in a single statement, such as <code>int i, j, k; </code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vdExpr</code> - variable declaration expression representing the current statement to simplify</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a list of <code>Statement</code> objects representing the simplified variable declaration
     expression</dd>
</dl>
</li>
</ul>
<a name="rhsAssignValueFromPassingAssertion-com.github.javaparser.ast.expr.VariableDeclarationExpr-java.util.Map-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rhsAssignValueFromPassingAssertion</h4>
<pre>private static&nbsp;com.github.javaparser.ast.stmt.Statement&nbsp;rhsAssignValueFromPassingAssertion(com.github.javaparser.ast.expr.VariableDeclarationExpr&nbsp;vdExpr,
                                                                                           <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;primitiveValues)</pre>
<div class="block">Return a variable declaration statement that simplifies the right hand side by a calculated
 value for primitive types. Returns null if there are multiple variable declarations in a single
 statement, such as <code>int i, j, k; </code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vdExpr</code> - variable declaration expression representing the current statement to simplify</dd>
<dd><code>primitiveValues</code> - a map of primitive variable names to expressions representing their
     values</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <code>Statement</code> object representing the simplified variable declaration expression
     if the type of the variable is a primitive and a value has been previously calculated.
     Otherwise, returns <code>null</code>. Also returns <code>null</code> if more than one variable is
     declared in the <code>VariableDeclarationExpr</code>.</dd>
</dl>
</li>
</ul>
<a name="rhsAssignWithValue-com.github.javaparser.ast.expr.VariableDeclarationExpr-com.github.javaparser.ast.type.Type-java.lang.String-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rhsAssignWithValue</h4>
<pre>private static&nbsp;com.github.javaparser.ast.stmt.Statement&nbsp;rhsAssignWithValue(com.github.javaparser.ast.expr.VariableDeclarationExpr&nbsp;vdExpr,
                                                                           com.github.javaparser.ast.type.Type&nbsp;exprType,
                                                                           <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre>
<div class="block">Return a variable declaration statement that sets the right hand side of a variable declaration
 to the value that is passed in.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vdExpr</code> - variable declaration expression representing the current statement to simplify</dd>
<dd><code>exprType</code> - type of the variable declaration expression, should not be null</dd>
<dd><code>value</code> - value that will be assigned to the variable being declared. If the value is null,
     then the right hand side will have the zero value of the variable declaration's type.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <code>Statement</code> object representing the simplified variable declaration expression.
     Returns <code>null</code> if more than one variable is declared in the <code>VariableDeclarationExpr</code>.</dd>
</dl>
</li>
</ul>
<a name="getLiteralExpression-java.lang.String-com.github.javaparser.ast.type.PrimitiveType.Primitive-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLiteralExpression</h4>
<pre>private static&nbsp;com.github.javaparser.ast.expr.LiteralExpr&nbsp;getLiteralExpression(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value,
                                                                               com.github.javaparser.ast.type.PrimitiveType.Primitive&nbsp;type)</pre>
<div class="block">Return a literal expression with the value that is passed in.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - the value for the literal expression. If null, the value of the literal expression
     will be the zero value for the type that is passed in.</dd>
<dd><code>type</code> - the type of the expression, needs to be one of the eight primitive types</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a literal expression containing the value that is passed in</dd>
</dl>
</li>
</ul>
<a name="removeLeftHandSideSimplification-com.github.javaparser.ast.expr.VariableDeclarationExpr-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeLeftHandSideSimplification</h4>
<pre>private static&nbsp;com.github.javaparser.ast.stmt.Statement&nbsp;removeLeftHandSideSimplification(com.github.javaparser.ast.expr.VariableDeclarationExpr&nbsp;vdExpr)</pre>
<div class="block">Return a statement that contains only the right hand side of a given statement. Returns null if
 there are multiple variable declarations in a single statement, such as <code>int i, j, k; </code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vdExpr</code> - variable declaration expression that represents the statement to simplify</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <code>Statement</code> object that is equal to the right-hand-side of <code>vdExpr</code>.
     Returns <code>null</code> if more than one variable is declared in the <code>VariableDeclarationExpr</code>.</dd>
</dl>
</li>
</ul>
<a name="simplifyTypeNames-com.github.javaparser.ast.CompilationUnit-java.lang.String-java.nio.file.Path-java.lang.String-java.util.Map-int-boolean-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>simplifyTypeNames</h4>
<pre>private static&nbsp;com.github.javaparser.ast.CompilationUnit&nbsp;simplifyTypeNames(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
                                                                           <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
                                                                           <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                                                                           <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
                                                                           <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;expectedOutput,
                                                                           int&nbsp;timeoutLimit,
                                                                           boolean&nbsp;verboseOutput)
                                                                    throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Simplify the type names in a compilation unit. For example, <code>java.lang.String</code> should be
 simplified to <code>String</code>. If two different types have the same simple type name, then the
 lexicographically first one is simplified and the other is left unchanged.

 <p>Additionally, sort the import statements of the compilation unit.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>compilationUnit</code> - compilation unit containing an AST for a Java file, the compilation unit
     will be modified if a correct minimization of the method is found</dd>
<dd><code>packageName</code> - the package that the Java file is in</dd>
<dd><code>file</code> - the Java file to simplify; is modified by side effect</dd>
<dd><code>classpath</code> - classpath needed to compile and run the Java file</dd>
<dd><code>expectedOutput</code> - expected standard output from running the JUnit test suite</dd>
<dd><code>timeoutLimit</code> - number of seconds allowed for the whole test suite to run</dd>
<dd><code>verboseOutput</code> - whether or not to output information about minimization status</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>CompilationUnit</code> with fully-qualified type names simplified to simple type names</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - thrown if write to file fails</dd>
</dl>
</li>
</ul>
<a name="checkCorrectlyMinimized-java.nio.file.Path-java.lang.String-java.lang.String-java.util.Map-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkCorrectlyMinimized</h4>
<pre>private static&nbsp;boolean&nbsp;checkCorrectlyMinimized(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                                               <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
                                               <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
                                               <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;expectedOutput,
                                               int&nbsp;timeoutLimit)</pre>
<div class="block">Check if a Java file has been correctly minimized. The file should not have compilation errors
 or run-time errors. The file should fail in the same way as the original file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the file being checked</dd>
<dd><code>classpath</code> - classpath needed to compile/run the Java file</dd>
<dd><code>packageName</code> - the package that the Java file is in</dd>
<dd><code>expectedOutput</code> - expected output of running the JUnit test suite</dd>
<dd><code>timeoutLimit</code> - number of seconds allowed for the whole test suite to run</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if there are no compilation and no run-time errors and the output is equal to the
     expected output</dd>
</dl>
</li>
</ul>
<a name="compileJavaFile-java.nio.file.Path-java.lang.String-java.lang.String-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>compileJavaFile</h4>
<pre>private static&nbsp;int&nbsp;compileJavaFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                                   <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;classpath,
                                   <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
                                   int&nbsp;timeoutLimit)</pre>
<div class="block">Compile a Java file and return the compilation exit value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the file to be compiled and executed</dd>
<dd><code>classpath</code> - dependencies and complete classpath to compile and run the Java program</dd>
<dd><code>packageName</code> - the package that the Java file is in</dd>
<dd><code>timeoutLimit</code> - number of seconds allowed for the whole test suite to run</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>exit value of compiling the Java file</dd>
</dl>
</li>
</ul>
<a name="runJavaFile-java.nio.file.Path-java.lang.String-java.lang.String-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>runJavaFile</h4>
<pre>private static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;runJavaFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                                  <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userClassPath,
                                  <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName,
                                  int&nbsp;timeoutLimit)</pre>
<div class="block">Run a Java file and return the standard output.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the file to be compiled and executed</dd>
<dd><code>userClassPath</code> - dependencies and complete classpath to compile and run the Java program</dd>
<dd><code>packageName</code> - the package that the Java file is in</dd>
<dd><code>timeoutLimit</code> - number of seconds allowed for the whole test suite to run</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>standard output from running the Java file</dd>
</dl>
</li>
</ul>
<a name="getExecutionDirectory-java.nio.file.Path-java.lang.String-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExecutionDirectory</h4>
<pre>private static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;getExecutionDirectory(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file,
                                          <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;packageName)</pre>
<div class="block">Get directory to execute command in, given file path and package name. Returns a <code>Path</code>
 pointing to the directory that the Java file should be executed in.

 <p>For the simplest case where the Java file is nested in a single package layer, i.e.
 MyJavaFile.java is in the package mypackage, the folder structure would be
 src/mypackage/MyJavaFile.java. Here, we need to execute the Java file in the src/ directory. We
 go up 2 layers from the directory of the Java file to get to the parent directory of the
 directory for the package. For the general case where MyJavaFile.java is nested within multiple
 layers of packages, we count the number of separators, i.e. ".", and add 2 to get the number of
 layers to go up from the Java file's directory.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the Java file to be executed</dd>
<dd><code>packageName</code> - package name of input Java file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the directory to execute the commands in, or null if packageName is null</dd>
</dl>
</li>
</ul>
<a name="runProcess-java.lang.String-java.nio.file.Path-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>runProcess</h4>
<pre>private static&nbsp;<a href="../../randoop/main/Minimize.Outputs.html" title="class in randoop.main">Minimize.Outputs</a>&nbsp;runProcess(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;command,
                                           <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;executionDir,
                                           int&nbsp;timeoutLimit)</pre>
<div class="block">Run a command given as a String and return the output and error results in an Outputs object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>command</code> - the input command to be run</dd>
<dd><code>executionDir</code> - the directory where the process commands should be executed</dd>
<dd><code>timeoutLimit</code> - number of seconds allowed for the whole test suite to run</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an <code>Outputs</code> object containing the standard and error output</dd>
</dl>
</li>
</ul>
<a name="normalizeJUnitOutput-java.lang.String-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normalizeJUnitOutput</h4>
<pre>private static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;normalizeJUnitOutput(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;input)</pre>
<div class="block">Normalize the standard output obtained from running a JUnit test suite. By normalizing the
 <code>String</code> representation of the output, we remove any extraneous information such as line
 numbers. The resulting output is a map from method name to the method's failure stack trace.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>input</code> - the <code>String</code> produced from running a JUnit test suite</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a map from method name to the method's failure stack trace. The stack trace will not
     contain any line numbers.</dd>
</dl>
</li>
</ul>
<a name="writeToFile-com.github.javaparser.ast.CompilationUnit-java.nio.file.Path-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeToFile</h4>
<pre>private static&nbsp;void&nbsp;writeToFile(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
                                <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file)
                         throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Write a compilation unit to a Java file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>compilationUnit</code> - the compilation unit to write to file</dd>
<dd><code>file</code> - file to write to</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - thrown if write to file fails</dd>
</dl>
</li>
</ul>
<a name="addImport-com.github.javaparser.ast.CompilationUnit-java.lang.String-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addImport</h4>
<pre>private static&nbsp;void&nbsp;addImport(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit,
                              <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;importName)</pre>
<div class="block">Add an import to the list of <code>ImportDeclaration</code>s of the compilation unit. This method
 adds the import statement if it has not been yet included in the list of current imports of the
 compilation unit.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>compilationUnit</code> - compilation unit to add import to</dd>
<dd><code>importName</code> - the name of the import</dd>
</dl>
</li>
</ul>
<a name="sortImports-com.github.javaparser.ast.CompilationUnit-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sortImports</h4>
<pre>private static&nbsp;void&nbsp;sortImports(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit)</pre>
<div class="block">Sort a compilation unit's imports by name.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>compilationUnit</code> - the compilation unit whose imports will be sorted by name</dd>
</dl>
</li>
</ul>
<a name="getFileLength-java.nio.file.Path-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFileLength</h4>
<pre>private static&nbsp;int&nbsp;getFileLength(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;file)
                          throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Calculate the length of a file, by number of lines.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the file to compute the length of</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of lines in the file. Returns -1 if an exception occurs while reading the
     file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - thrown if error reading file</dd>
</dl>
</li>
</ul>
<a name="cleanUp-java.nio.file.Path-boolean-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cleanUp</h4>
<pre>private static&nbsp;void&nbsp;cleanUp(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;outputFile,
                            boolean&nbsp;verboseOutput)</pre>
<div class="block">Deletes the .class file associated with the outputFile.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>outputFile</code> - the source file for the class file to be removed</dd>
<dd><code>verboseOutput</code> - whether to print information about minimization status</dd>
</dl>
</li>
</ul>
<a name="getNumberOfTestMethods-com.github.javaparser.ast.CompilationUnit-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumberOfTestMethods</h4>
<pre>private static&nbsp;int&nbsp;getNumberOfTestMethods(com.github.javaparser.ast.CompilationUnit&nbsp;compilationUnit)</pre>
<div class="block">Return the number of JUnit test methods in a compilation unit</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>compilationUnit</code> - the compilation unit to count the number of unit test methods</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of unit test methods in compilationUnit</dd>
</dl>
</li>
</ul>
<a name="printProgress-int-int-java.lang.String-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>printProgress</h4>
<pre>private static&nbsp;void&nbsp;printProgress(int&nbsp;currentTestIndex,
                                  int&nbsp;totalTests,
                                  <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;testName)</pre>
<div class="block">Output the minimizer's current progress</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>currentTestIndex</code> - the number of tests that have been minimized so far</dd>
<dd><code>totalTests</code> - the total number of tests in the input test suite</dd>
<dd><code>testName</code> - the current test method being minimized</dd>
</dl>
</li>
</ul>
<a name="usage-java.lang.String-java.lang.Object...-">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>usage</h4>
<pre>private&nbsp;void&nbsp;usage(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
                   <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;args)</pre>
<div class="block">Print message, then print usage information.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - the string format</dd>
<dd><code>args</code> - the arguments</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../randoop/main/Main.html" title="class in randoop.main"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../randoop/main/Minimize.Outputs.html" title="class in randoop.main"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?randoop/main/Minimize.html" target="_top">Frames</a></li>
<li><a href="Minimize.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
